﻿using YiShop.System.Events;
using YiShop.System.Repositories;

namespace YiShop.System.EventHandlers
{
    public class LogInforCreateEventHandler : INotificationHandler<LogInforCreateEvent>
    {
        private readonly SysLogininforService _logininforService;

        public LogInforCreateEventHandler(SysLogininforService logininforService)
        {
            _logininforService = logininforService;
        }

        public async Task Handle(LogInforCreateEvent notification, CancellationToken cancellationToken)
        {
            await _logininforService.AddAsync(notification.Username, notification.Status, notification.Message);
        }
    }
}